@@ -86,7 +86,6 @@ def eqpt_onoff(request): |
||
86 | 86 |
return response(ThermometerEquipmentStatusCode.THERMOMETER_EQUIPMENT_NOT_FOUND) |
87 | 87 |
|
88 | 88 |
eqpt.active_status = active |
89 |
- eqpt.active_at = tc.utc_datetime() |
|
90 | 89 |
eqpt.save() |
91 | 90 |
|
92 | 91 |
if active == 0: |
@@ -91,6 +91,9 @@ def bind_eqpt(request): |
||
91 | 91 |
ipui = IsolationPointUserInfo.objects.get(user_id=user_id, status=True) |
92 | 92 |
except IsolationPointUserInfo.DoesNotExist: |
93 | 93 |
return response(IsolationPointStatusCode.ISOLATIONPOINT_USER_NOT_FOUND) |
94 |
+ |
|
95 |
+ # 清除之前绑定的设备 |
|
96 |
+ ThermometerEquipmentInfo.objects.filter(ipui_pk=ipui.pk).update(active_status=ThermometerEquipmentInfo.OFFLINE) |
|
94 | 97 |
|
95 | 98 |
ThermometerEquipmentInfo.objects.update_or_create(macid=macid, defaults={ |
96 | 99 |
'point_id': ipui.point_id, |